import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { PassportModule } from '@nestjs/passport';
import { UserModule } from '../user/user.module';
import { JwtStrategy } from './jwt.strategy';
import { LocalStrategy } from './local.strategy';
import { AuthService } from './auth.service';
import { jwtConstants } from './constants';

@Module({
    imports: [
        PassportModule.register({defaultStrategy:'jwt'}),
        JwtModule.register({
            secret: jwtConstants.secret,
            signOptions: {
                expiresIn: '8h'
            }
        }),
        UserModule
    ],
    exports: [AuthService],
    providers: [AuthService,LocalStrategy,JwtStrategy],

})
export class AuthModule {}
